
#ifndef AI9_LOGIC_2017_TYPEGATHER_H
#define AI9_LOGIC_2017_TYPEGATHER_H
#include "sdk/const.h"
#include "skill.h"
#include "entity.h"
#include "sdk/point.h"
#include "Game/Game.h"
#include "Entities/plant.h"
#include "Skills/automatic.h"
namespace skill {
	class AirborneSurge : public Buff{
	public:
		int power;
		explicit AirborneSurge(int _power):Buff(AirborneTurn), power(_power){
			this->setName("AirborneSurge");
			this->turn = AuxiliaryTurn;
		}

        bool use(Game *g, const std::vector<std::string> &params) override;
    };
	/*
		Airborne (空投)
		params[0] 生成位置: Point((int) x, (int) y).to_string()
		params[1] 配送能量: to_string((int) power)
	*/
    class Airborne : public CoolDownSkill{
    public:
        explicit Airborne(): CoolDownSkill() {
            this->setName("Airborne");
			this->cd = AirborneCD;
            this->turn = AuxiliaryTurn;
        }

        virtual bool canUse(Game *g, const std::vector<std::string> &params) override;

        virtual bool use(Game *g, const std::vector<std::string> &params) override;
    };
	/*
		Overload (过载)
		不需要任何参数
	*/
	class OverloadLowBuff: public Buff{
	public:
		OverloadLowBuff(): Buff(LowRank){
            this->setName("OverloadLowBuff");
		}

		bool onLearn(Game *g) override {
			origin->useSkill("ReCalculateStats", {});
			return Buff::onLearn(g);
		}
	};
	class OverloadHighBuff: public Buff{
	public:
		OverloadHighBuff(): Buff(HighRank){
            this->setName("OverloadHighBuff");
		}

		bool onLearn(Game *g) override {
			origin->useSkill("ReCalculateStats", {});
			return Buff::onLearn(g);
		}

		virtual bool onUnlearn() override{
            if (!Buff::onUnlearn()) return false;
			origin->learnSkill(new OverloadLowBuff);
            return true;
		}
	};
    class Overload: public CoolDownSkill{
    public:
        explicit Overload(): CoolDownSkill(){
            this->setName("Overload");
			this->cd = OverloadCD;
			this->turn = TurnName::AuxiliaryTurn;
        }

        virtual bool canUse(Game *g, const std::vector<std::string> &params) override;

        virtual bool use(Game *g, const std::vector<std::string> &params) override;
    };
}
#endif //AI9_LOGIC_2017_TYPEGATHER_H
